package NO08;

/**
 * 斐波拉契数列
 * @author swg
 *
 */
public class Fibonacci {
	public static int fibonacci(int target){
		int a = 1,b = 1,c = 0;
		if(target <= 0){
			return 0;
		}else if(target == 1 || target == 2){
			return 1;
		} else{
			for(int i=3;i<=target;i++){
				c = a+b;
				a = b;
				b = c;	
			}
			return c;
		}
	}
	
	public static void main(String[] args) {
		System.out.println(fibonacci(11));
	}
}
